import asyncio

from pyxxl import ExecutorConfig, PyxxlRunner
from pyxxl.ctx import g

config = ExecutorConfig(
    xxl_admin_baseurl="http://localhost:8080/xxl-job-admin/api/",
    executor_app_name="python-house",
    executor_host="172.17.0.1",
    access_token="default_token"
)

app = PyxxlRunner(config)


# 抓取房产信息
@app.handler.register(name="houseHandler")
async def houseHandler():
    param = g.xxl_run_data.executorParams
    g.logger.info("get executor params: %s" % param)
    return "成功..."


app.run_executor()
